package com.android.tea;

import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ListView;
import android.widget.TextView;

import com.android.tea.adapter.MessageboxAdapter;
import com.android.tea.entity.NotifyInfo;

public class MessageBoxActivity extends Activity implements OnClickListener {
	ListView footprintList;
	private Button btnBack;
	private TextView title_this;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.footprint);
		title_this = (TextView) findViewById(R.id.title_this);
		title_this.setText("消息中心 ");
		footprintList = (ListView) findViewById(R.id.footprintLists);
		MessageboxAdapter adapter = new MessageboxAdapter(this, loadData());
		footprintList.setAdapter(adapter);
		btnBack = (Button) findViewById(R.id.btn_back);
		btnBack.setOnClickListener(this);
	}

	private List<NotifyInfo> loadData() {
		List<NotifyInfo> list = new ArrayList<NotifyInfo>();
		NotifyInfo member4 = new NotifyInfo();
		member4.setTitle("到货通知");
		member4.setDesc("花相惜3花相惜1花相惜1花相惜1花相惜1花花相惜3花相惜1花相惜1花相惜1花相惜1花花相惜3花相惜1花相惜1花相惜1花相惜1花花相惜3花相惜1花相惜1花相惜1花相惜1花");
		member4.setAvatar("2012-12-12");
		list.add(member4);

		NotifyInfo member = new NotifyInfo();
		member.setDesc("花相惜3花相惜1花相惜1花相惜1花相惜1花花相惜3花相惜1花相惜1花相惜1花相惜1花花相惜3花相惜1花相惜1花相惜1花相惜1花花相惜3花相惜1花相惜1花相惜1花相惜1花");
		list.add(member);

		NotifyInfo member1 = new NotifyInfo();
		member1.setTitle("到货通知");
		member1.setDesc("花相惜3花相惜1花相惜1花相惜1花相惜1花花相惜3花相惜1花相惜1花相惜1花相惜1花花相惜3花相惜1花相惜1花相惜1花相惜1花花相惜3花相惜1花相惜1花相惜1花相惜1花");
		member4.setAvatar("2012-12-12");
		list.add(member1);

		NotifyInfo member2 = new NotifyInfo();
		member2.setTitle("到货通知");
		member4.setAvatar("2012-12-12");
		member2.setDesc("花相惜3花相惜1花相惜1花相惜1花相惜1花花相惜3花相惜1花相惜1花相惜1花相惜1花花相惜3花相惜1花相惜1花相惜1花相惜1花花相惜3花相惜1花相惜1花相惜1花相惜1花");
		list.add(member2);

		NotifyInfo member3 = new NotifyInfo();
		member3.setTitle("到货通知");
		member4.setAvatar("2012-12-12");
		member3.setDesc("花相惜3花相惜1花相惜1花相惜1花相惜1花花相惜3花相惜1花相惜1花相惜1花相惜1花花相惜3花相惜1花相惜1花相惜1花相惜1花花相惜3花相惜1花相惜1花相惜1花相惜1花");
		list.add(member3);

		NotifyInfo member5 = new NotifyInfo();
		member5.setTitle("到货通知");
		member5.setDesc("花相惜3花相惜1花相惜1花相惜1花相惜1花花相惜3花相惜1花相惜1花相惜1花相惜1花花相惜3花相惜1花相惜1花相惜1花相惜1花花相惜3花相惜1花相惜1花相惜1花相惜1花");
		member4.setAvatar("2012-12-12");
		list.add(member5);

		return list;
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.btn_back:
			super.onBackPressed();
			break;

		default:
			break;

		}

	}
}
